﻿using System;
using System.Linq;
using DeckOfCards.HappyFamilies;
using DeckOfCards.PlayingCards;

namespace DeckOfCards.TestConsole
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            var deck = new PlayingCardDeck(2);

            Console.WriteLine("====== Playing Cards ======");

            foreach (var card in deck.OrderBy(x => x.Suit))
                Console.WriteLine(card.ToString());

            Console.WriteLine("====== Playing Cards Shuffled & 2 Hands Assigned ======");

            deck.Shuffle();

            var hand1 = new Hand();
            var hand2 = new Hand();

            deck.AssignSet(7, hand1);
            deck.AssignSet(7, hand2);

            foreach (var card in deck)
                Console.WriteLine(card.ToString());

            var hfDeck = new HappyFamiliesDeck();

            Console.WriteLine("====== Happy Families Cards ======");

            foreach (var card in hfDeck)
                Console.WriteLine(card.Code.PadLeft(12, ' ') + "     " + card.Description);

            hfDeck.Shuffle();

            hfDeck.AssignSet(4, hand1);

            Console.WriteLine("====== Happy Families Cards Shuffled ======");

            foreach (var card in hfDeck)
                Console.WriteLine(card.Code.PadLeft(12, ' ') + "     " + card.Description);

            Console.ReadKey();
        }
    }
}